Optimal. Leaf size=135 \[ \frac {\left (4 a^2 c e-6 a b c d+b^3 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \left (b^2-4 a c\right )^{3/2}}-\frac {d \log \left (a+b x+c x^2\right )}{2 a^2}+\frac {d \log (x)}{a^2}+\frac {c x (b d-2 a e)-a b e-2 a c d+b^2 d}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )} \]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {822, 800, 634, 618, 206, 628} \begin {gather*} \frac {\left (4 a^2 c e-6 a b c d+b^3 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \left (b^2-4 a c\right )^{3/2}}-\frac {d \log \left (a+b x+c x^2\right )}{2 a^2}+\frac {d \log (x)}{a^2}+\frac {c x (b d-2 a e)-a b e-2 a c d+b^2 d}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 800
Rule 822
Rubi steps
\begin {align*} \int \frac {d+e x}{x \left (a+b x+c x^2\right )^2} \, dx &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac {\int \frac {-\left (\left (b^2-4 a c\right ) d\right )-c (b d-2 a e) x}{x \left (a+b x+c x^2\right )} \, dx}{a \left (b^2-4 a c\right )}\\ &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac {\int \left (\frac {\left (-b^2+4 a c\right ) d}{a x}+\frac {b^3 d-5 a b c d+2 a^2 c e+c \left (b^2-4 a c\right ) d x}{a \left (a+b x+c x^2\right )}\right ) \, dx}{a \left (b^2-4 a c\right )}\\ &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac {d \log (x)}{a^2}-\frac {\int \frac {b^3 d-5 a b c d+2 a^2 c e+c \left (b^2-4 a c\right ) d x}{a+b x+c x^2} \, dx}{a^2 \left (b^2-4 a c\right )}\\ &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac {d \log (x)}{a^2}-\frac {d \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 a^2}-\frac {\left (b^3 d-6 a b c d+4 a^2 c e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 a^2 \left (b^2-4 a c\right )}\\ &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac {d \log (x)}{a^2}-\frac {d \log \left (a+b x+c x^2\right )}{2 a^2}+\frac {\left (b^3 d-6 a b c d+4 a^2 c e\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{a^2 \left (b^2-4 a c\right )}\\ &=\frac {b^2 d-2 a c d-a b e+c (b d-2 a e) x}{a \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac {\left (b^3 d-6 a b c d+4 a^2 c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \left (b^2-4 a c\right )^{3/2}}+\frac {d \log (x)}{a^2}-\frac {d \log \left (a+b x+c x^2\right )}{2 a^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 134, normalized size = 0.99 \begin {gather*} \frac {\frac {2 \left (4 a^2 c e-6 a b c d+b^3 d\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right )}{\left (4 a c-b^2\right )^{3/2}}-\frac {2 a \left (b (a e-c d x)+2 a c (d+e x)+b^2 (-d)\right )}{\left (b^2-4 a c\right ) (a+x (b+c x))}-d \log (a+x (b+c x))+2 d \log (x)}{2 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x}{x \left (a+b x+c x^2\right )^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.85, size = 955, normalized size = 7.07 \begin {gather*} \left [-\frac {{\left (4 \, a^{3} c e + {\left (4 \, a^{2} c^{2} e + {\left (b^{3} c - 6 \, a b c^{2}\right )} d\right )} x^{2} + {\left (a b^{3} - 6 \, a^{2} b c\right )} d + {\left (4 \, a^{2} b c e + {\left (b^{4} - 6 \, a b^{2} c\right )} d\right )} x\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - 2 \, {\left (a b^{4} - 6 \, a^{2} b^{2} c + 8 \, a^{3} c^{2}\right )} d + 2 \, {\left (a^{2} b^{3} - 4 \, a^{3} b c\right )} e - 2 \, {\left ({\left (a b^{3} c - 4 \, a^{2} b c^{2}\right )} d - 2 \, {\left (a^{2} b^{2} c - 4 \, a^{3} c^{2}\right )} e\right )} x + {\left ({\left (b^{4} c - 8 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d x^{2} + {\left (b^{5} - 8 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d x + {\left (a b^{4} - 8 \, a^{2} b^{2} c + 16 \, a^{3} c^{2}\right )} d\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{4} c - 8 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d x^{2} + {\left (b^{5} - 8 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d x + {\left (a b^{4} - 8 \, a^{2} b^{2} c + 16 \, a^{3} c^{2}\right )} d\right )} \log \relax (x)}{2 \, {\left (a^{3} b^{4} - 8 \, a^{4} b^{2} c + 16 \, a^{5} c^{2} + {\left (a^{2} b^{4} c - 8 \, a^{3} b^{2} c^{2} + 16 \, a^{4} c^{3}\right )} x^{2} + {\left (a^{2} b^{5} - 8 \, a^{3} b^{3} c + 16 \, a^{4} b c^{2}\right )} x\right )}}, \frac {2 \, {\left (4 \, a^{3} c e + {\left (4 \, a^{2} c^{2} e + {\left (b^{3} c - 6 \, a b c^{2}\right )} d\right )} x^{2} + {\left (a b^{3} - 6 \, a^{2} b c\right )} d + {\left (4 \, a^{2} b c e + {\left (b^{4} - 6 \, a b^{2} c\right )} d\right )} x\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left (a b^{4} - 6 \, a^{2} b^{2} c + 8 \, a^{3} c^{2}\right )} d - 2 \, {\left (a^{2} b^{3} - 4 \, a^{3} b c\right )} e + 2 \, {\left ({\left (a b^{3} c - 4 \, a^{2} b c^{2}\right )} d - 2 \, {\left (a^{2} b^{2} c - 4 \, a^{3} c^{2}\right )} e\right )} x - {\left ({\left (b^{4} c - 8 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d x^{2} + {\left (b^{5} - 8 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d x + {\left (a b^{4} - 8 \, a^{2} b^{2} c + 16 \, a^{3} c^{2}\right )} d\right )} \log \left (c x^{2} + b x + a\right ) + 2 \, {\left ({\left (b^{4} c - 8 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d x^{2} + {\left (b^{5} - 8 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d x + {\left (a b^{4} - 8 \, a^{2} b^{2} c + 16 \, a^{3} c^{2}\right )} d\right )} \log \relax (x)}{2 \, {\left (a^{3} b^{4} - 8 \, a^{4} b^{2} c + 16 \, a^{5} c^{2} + {\left (a^{2} b^{4} c - 8 \, a^{3} b^{2} c^{2} + 16 \, a^{4} c^{3}\right )} x^{2} + {\left (a^{2} b^{5} - 8 \, a^{3} b^{3} c + 16 \, a^{4} b c^{2}\right )} x\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 160, normalized size = 1.19 \begin {gather*} -\frac {{\left (b^{3} d - 6 \, a b c d + 4 \, a^{2} c e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (a^{2} b^{2} - 4 \, a^{3} c\right )} \sqrt {-b^{2} + 4 \, a c}} - \frac {d \log \left (c x^{2} + b x + a\right )}{2 \, a^{2}} + \frac {d \log \left ({\left | x \right |}\right )}{a^{2}} + \frac {a b^{2} d - 2 \, a^{2} c d - a^{2} b e + {\left (a b c d - 2 \, a^{2} c e\right )} x}{{\left (c x^{2} + b x + a\right )} {\left (b^{2} - 4 \, a c\right )} a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.06, size = 337, normalized size = 2.50 \begin {gather*} -\frac {b c d x}{\left (c \,x^{2}+b x +a \right ) \left (4 a c -b^{2}\right ) a}-\frac {6 b c d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (4 a c -b^{2}\right )^{\frac {3}{2}} a}+\frac {b^{3} d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (4 a c -b^{2}\right )^{\frac {3}{2}} a^{2}}+\frac {2 c e x}{\left (c \,x^{2}+b x +a \right ) \left (4 a c -b^{2}\right )}+\frac {4 c e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (4 a c -b^{2}\right )^{\frac {3}{2}}}-\frac {b^{2} d}{\left (c \,x^{2}+b x +a \right ) \left (4 a c -b^{2}\right ) a}-\frac {2 c d \ln \left (c \,x^{2}+b x +a \right )}{\left (4 a c -b^{2}\right ) a}+\frac {b^{2} d \ln \left (c \,x^{2}+b x +a \right )}{2 \left (4 a c -b^{2}\right ) a^{2}}+\frac {b e}{\left (c \,x^{2}+b x +a \right ) \left (4 a c -b^{2}\right )}+\frac {2 c d}{\left (c \,x^{2}+b x +a \right ) \left (4 a c -b^{2}\right )}+\frac {d \ln \relax (x )}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.42, size = 920, normalized size = 6.81 \begin {gather*} \frac {\frac {-d\,b^2+a\,e\,b+2\,a\,c\,d}{a\,\left (4\,a\,c-b^2\right )}+\frac {c\,x\,\left (2\,a\,e-b\,d\right )}{a\,\left (4\,a\,c-b^2\right )}}{c\,x^2+b\,x+a}-\ln \left (96\,a^4\,c^3\,d-2\,a\,b^6\,d-2\,b^7\,d\,x-84\,a^3\,b^2\,c^2\,d+2\,a\,b^3\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+23\,a^2\,b^4\,c\,d-2\,a^3\,b^3\,c\,e+8\,a^4\,b\,c^2\,e+2\,a^3\,c\,e\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+2\,b^4\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-16\,a^4\,c^3\,e\,x-9\,a^2\,b\,c\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+120\,a^3\,b\,c^3\,d\,x-2\,a^2\,b^4\,c\,e\,x-94\,a^2\,b^3\,c^2\,d\,x+12\,a^2\,c^2\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+12\,a^3\,b^2\,c^2\,e\,x+24\,a\,b^5\,c\,d\,x-12\,a\,b^2\,c\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+2\,a^2\,b\,c\,e\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}\right )\,\left (\frac {d}{2\,a^2}-\frac {\frac {b^3\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}}{2}+2\,a^2\,c\,e\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-3\,a\,b\,c\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}}{-64\,a^5\,c^3+48\,a^4\,b^2\,c^2-12\,a^3\,b^4\,c+a^2\,b^6}\right )-\ln \left (2\,a\,b^6\,d-96\,a^4\,c^3\,d+2\,b^7\,d\,x+84\,a^3\,b^2\,c^2\,d+2\,a\,b^3\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-23\,a^2\,b^4\,c\,d+2\,a^3\,b^3\,c\,e-8\,a^4\,b\,c^2\,e+2\,a^3\,c\,e\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+2\,b^4\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+16\,a^4\,c^3\,e\,x-9\,a^2\,b\,c\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-120\,a^3\,b\,c^3\,d\,x+2\,a^2\,b^4\,c\,e\,x+94\,a^2\,b^3\,c^2\,d\,x+12\,a^2\,c^2\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-12\,a^3\,b^2\,c^2\,e\,x-24\,a\,b^5\,c\,d\,x-12\,a\,b^2\,c\,d\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}+2\,a^2\,b\,c\,e\,x\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}\right )\,\left (\frac {d}{2\,a^2}+\frac {\frac {b^3\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}}{2}+2\,a^2\,c\,e\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}-3\,a\,b\,c\,d\,\sqrt {-{\left (4\,a\,c-b^2\right )}^3}}{-64\,a^5\,c^3+48\,a^4\,b^2\,c^2-12\,a^3\,b^4\,c+a^2\,b^6}\right )+\frac {d\,\ln \relax (x)}{a^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________